from urllib.request import urlopen

if __name__ == '__main__':
    # 要获取页面的网址
    url = "https://www.scct.cn"

    resp = urlopen(url=url)
    print(type(resp))
    # 获取 HTTP 响应状态码
    print(resp.getcode())

    # 读响应内容
    content = resp.read().decode("utf-8")
    print(content)

    # 将响应的内容保存到文件
    with open(file="../scct.html", mode="w", encoding="utf-8") as f:
        f.write(content)

